<?php
class model_lu extends Model
{
	function __construct()
	{
		parent::__construct();
	}
	
	function get($type="*")
	{
		$this	->db->select("*")
				->from("lookup")
				->order_by("lu_lable","lu_type");
		if($type != "*")
		{
			$this->db->where(array("lu_type"=>$type));
		}
				
		$r = $this->db->get();
		
		return $r->result_array();	
	}

	function get_from_id($id="")
	{
		$this	->db->select("*")
				->from("lookup")
			    ->where(array("id"=>$id));
				
		$r = $this->db->get();
		
		return $r->row_array();	
	}
	
	function update($data, $id)
	{
		$this->db->update('lookup', $data, array("id" => $id));
		
	}
	
	function get_SYS_MSG()
	{
		$r = $this->db->query("select * from lookup where lu_lable = 'SYS_WELCOME_MSG'");
		$rs = $r->row_array();
		return $rs['lu_value'];
	}
	
}